package com.neu.service;

import com.neu.mapper.FundMapper;
import com.neu.pojo.Fund;
import com.neu.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class FundServiceImpl implements FundService{
    @Autowired
    private FundMapper fundMapper;
    @Override
    public int insertFund(Fund fund) {
        return fundMapper.insertFund(fund);
    }

    @Override
    public Fund getFundByCode(String code) {
        return fundMapper.getFundByCode(code);
    }

    @Override
    public List<Fund> getFundByName(String name) {
        return fundMapper.getFundByName(name);
    }

    @Override
    public List<Fund> getFundByType(String type) {
        return fundMapper.getFundByType(type);
    }
    public List<Fund> getFundByTypeRandom(String type, int length){
        return fundMapper.getFundByTypeRandom(type, length);
    }

    @Override
    public List<Fund> getAllFund() {
        return fundMapper.getAllFund();
    }

//    @Override
//    public List<Fund> getTypeByPreference(User user) {
//        return fundMapper.getTypeByPreference(user);
//    }
}
